Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for cameras without UTCDateTime #165

Merged
merged 1 commit into from
Nov 5, 2020
Merged

Fix for cameras without UTCDateTime #165

merged 1 commit into from
Nov 5, 2020

Conversation

dzek69
Copy link
Contributor

@dzek69 dzek69 commented May 25, 2020

Fixes #160, tested on real device that has this issue

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 87.872% when pulling 2ccbd70 on dzek69:dateTimeFix into e2ab59e on agsh:master.

@chriswiggins
Copy link
Collaborator

Thanks @dzek69 - Should we not be then converting this date to UTC before setting it?

Can you print the XML that the camera is returning?

@dzek69
Copy link
Contributor Author

dzek69 commented May 25, 2020

Could be different for different cameras but mine's doesn't define timezone, so I cannot really convert it in any way.

The XML:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope                         ><SOAP-ENV:Body><tds:GetSystemDateAndTimeResponse><tds:SystemDateAndTime><tt:DateTimeType>NTP</tt:DateTimeType><tt:DaylightSavings>false</tt:DaylightSavings><tt:LocalDateTime><tt:Time><tt:Hour>0</tt:Hour><tt:Minute>0</tt:Minute><tt:Second>50</tt:Second></tt:Time><tt:Date><tt:Year>1979</tt:Year><tt:Month>11</tt:Month><tt:Day>30</tt:Day></tt:Date></tt:LocalDateTime></tds:SystemDateAndTime></tds:GetSystemDateAndTimeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

This camera is insecure so I'm not allowing it access to the internet, so the date is wrong.

@RogerHardiman
Copy link
Collaborator

Hi
I've just borrowed a cheap no-name camera and have the same thing.

Just looking at the Pull Request now.

@chriswiggins chriswiggins merged commit 2cdafa0 into agsh:master Nov 5, 2020
@chriswiggins
Copy link
Collaborator

This should really have a test around it but the changes to the code don't affect the current functionality, so merging in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some cameras not return UTCDateTime, but return localDateTime, please correct
4 participants